package com.zanglikun.activity;

import com.zanglikun.activity.util.Activity;
import com.zanglikun.activity.util.ActivityContext;

/**
 * @author : zanglikun
 * @date : 2025/10/31 14:29
 * @desc : Copyright © zanglikun.com
 */
public class ValidateOrderActivity  implements Activity {
    @Override
    public boolean execute(ActivityContext context) {
        System.out.println("【验证订单】开始验证订单信息...");
        String orderId = (String) context.get("orderId");

        if (orderId == null || orderId.isEmpty()) {
            throw new IllegalArgumentException("订单ID不能为空");
        }

        context.put("validated", true);
        System.out.println("【验证订单】✓ 订单验证通过");
        return true;
    }

    @Override
    public String getName() {
        return "ValidateOrderActivity";
    }
}